package ru.stepuk.modern.gui;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JPanel;
import org.apache.commons.collections15.Factory;
import ru.stepuk.modern.distributions.*;
import ru.stepuk.modern.nodes.DistributionDependent;
import ru.stepuk.modern.nodes.Node;
import ru.stepuk.modern.nodes.Source;

/**
 *
 * @author ivan
 */
public class SetDistributionDialog extends javax.swing.JDialog implements Factory<Distribution> {

    private DistributionDependent target;
    private boolean locked = false;

    /** Creates new form SetDistributionDialog */
    public SetDistributionDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    public SetDistributionDialog(DistributionDependent target, boolean locked) {
        this.target = target;
        initComponents();

        Distribution curDist = target.getDistribution();
        String tu = ((Node) target).getModel().getTimeUnit().toString();
        String rn = ((Node) target).getModel().getRequestName();

        setTitle("Параметры распределения для " + ((Node) target).getName());

        expLabel.setText("Частота (" + rn + " / " + tu + ")");
        uniformLabel1.setText("Минимум (" + tu + ")");
        uniformLabel2.setText("Максимум (" + tu + ")");
        degenerateLabel.setText("Значение (" + tu + ")");
        discreteLabel1.setText("Значения (" + tu + ")");
        erlangLabel.setText("Частота (" + rn + " / " + tu + ")");

        if (curDist instanceof ExponentialDistribution) {
            jComboBox1.setSelectedIndex(0);

            expSpinner.setValue(((ExponentialDistribution) target.getDistribution()).getRate());
        } else if (curDist instanceof UniformDistribution) {
            jComboBox1.setSelectedIndex(1);

            uniformSpinner1.setValue(((UniformDistribution) target.getDistribution()).getMin());
            uniformSpinner2.setValue(((UniformDistribution) target.getDistribution()).getMax());
        } else if (curDist instanceof DegenerateDistribution) {
            jComboBox1.setSelectedIndex(2);

            degenerateSpinner.setValue(((DegenerateDistribution) target.getDistribution()).nextValue());
        } else if (curDist instanceof DiscreteDistribution) {
            jComboBox1.setSelectedIndex(3);

            double[] x = ((DiscreteDistribution) target.getDistribution()).getX();
            int[] p = ((DiscreteDistribution) target.getDistribution()).getP();

            StringBuilder xText = new StringBuilder();
            StringBuilder pText = new StringBuilder();
            for (int i = 0; i < p.length; i++) {
                xText.append(x[i]).append(' ');
                pText.append(p[i]).append(' ');
            }

            jTextField1.setText(xText.toString());
            jTextField2.setText(pText.toString());
        } else if (curDist instanceof ErlangDistribution) {
            jComboBox1.setSelectedIndex(4);

            jSpinner1.setValue(((ErlangDistribution) target.getDistribution()).getRate());
            jSpinner2.setValue(((ErlangDistribution) target.getDistribution()).getShape());
        }

        if (locked) {
            jComboBox1.setEnabled(false);
        }

    }

    private void choosePanel(JPanel panel) {
        for (Component c : jLayeredPane1.getComponents()) {
            c.setVisible(false);
        }
        panel.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jComboBox1 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        degeneratePanel = new javax.swing.JPanel();
        degenerateSpinner = new javax.swing.JSpinner();
        degenerateLabel = new javax.swing.JLabel();
        uniformPanel = new javax.swing.JPanel();
        uniformSpinner1 = new javax.swing.JSpinner();
        uniformSpinner2 = new javax.swing.JSpinner();
        uniformLabel1 = new javax.swing.JLabel();
        uniformLabel2 = new javax.swing.JLabel();
        expPanel = new javax.swing.JPanel();
        expLabel = new javax.swing.JLabel();
        expSpinner = new javax.swing.JSpinner();
        discretePanel = new javax.swing.JPanel();
        discreteLabel1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        discreteLabel2 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        erlangPanel = new javax.swing.JPanel();
        erlangLabel = new javax.swing.JLabel();
        jSpinner1 = new javax.swing.JSpinner();
        jLabel2 = new javax.swing.JLabel();
        jSpinner2 = new javax.swing.JSpinner();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setAlwaysOnTop(true);
        setLocationByPlatform(true);
        setResizable(false);

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Экспоненциальное", "Равномерное", "Вырожденное (константа)", "Дискретное", "Эрланга" }));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jLabel1.setText("Вид распределения");

        jLayeredPane1.setBackground(new java.awt.Color(0, 0, 102));

        degenerateSpinner.setModel(new javax.swing.SpinnerNumberModel(Double.valueOf(1.0d), Double.valueOf(0.0010d), null, Double.valueOf(0.01d)));

        degenerateLabel.setText("Значение");

        javax.swing.GroupLayout degeneratePanelLayout = new javax.swing.GroupLayout(degeneratePanel);
        degeneratePanel.setLayout(degeneratePanelLayout);
        degeneratePanelLayout.setHorizontalGroup(
            degeneratePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(degeneratePanelLayout.createSequentialGroup()
                .addGroup(degeneratePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(degenerateSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(degenerateLabel))
                .addContainerGap())
        );
        degeneratePanelLayout.setVerticalGroup(
            degeneratePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(degeneratePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(degenerateLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(degenerateSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        degeneratePanel.setBounds(0, 0, 170, 70);
        jLayeredPane1.add(degeneratePanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        uniformSpinner1.setModel(new javax.swing.SpinnerNumberModel(Double.valueOf(1.0d), Double.valueOf(0.0010d), null, Double.valueOf(0.01d)));

        uniformSpinner2.setModel(new javax.swing.SpinnerNumberModel(Double.valueOf(2.0d), Double.valueOf(0.0010d), null, Double.valueOf(0.01d)));

        uniformLabel1.setText("Минимум");

        uniformLabel2.setText("Максимум");

        javax.swing.GroupLayout uniformPanelLayout = new javax.swing.GroupLayout(uniformPanel);
        uniformPanel.setLayout(uniformPanelLayout);
        uniformPanelLayout.setHorizontalGroup(
            uniformPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(uniformPanelLayout.createSequentialGroup()
                .addGroup(uniformPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(uniformLabel1)
                    .addComponent(uniformSpinner1, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(uniformLabel2)
                    .addComponent(uniformSpinner2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                .addContainerGap())
        );
        uniformPanelLayout.setVerticalGroup(
            uniformPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(uniformPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(uniformLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(uniformSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(uniformLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(uniformSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        uniformPanel.setBounds(0, 0, 170, 130);
        jLayeredPane1.add(uniformPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        expLabel.setText("Частота");

        expSpinner.setModel(new javax.swing.SpinnerNumberModel(Double.valueOf(1.0d), Double.valueOf(0.0010d), null, Double.valueOf(0.01d)));

        javax.swing.GroupLayout expPanelLayout = new javax.swing.GroupLayout(expPanel);
        expPanel.setLayout(expPanelLayout);
        expPanelLayout.setHorizontalGroup(
            expPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expPanelLayout.createSequentialGroup()
                .addGroup(expPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(expLabel)
                    .addComponent(expSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                .addContainerGap())
        );
        expPanelLayout.setVerticalGroup(
            expPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(expLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(expSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        expPanel.setBounds(0, 0, 170, 70);
        jLayeredPane1.add(expPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        discreteLabel1.setText("Значения");

        jTextField1.setText("1");

        discreteLabel2.setText("Вероятности (%)");

        jTextField2.setText("100");

        javax.swing.GroupLayout discretePanelLayout = new javax.swing.GroupLayout(discretePanel);
        discretePanel.setLayout(discretePanelLayout);
        discretePanelLayout.setHorizontalGroup(
            discretePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(discretePanelLayout.createSequentialGroup()
                .addGroup(discretePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(discreteLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(discreteLabel2)
                    .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                .addContainerGap())
        );
        discretePanelLayout.setVerticalGroup(
            discretePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(discretePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(discreteLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(discreteLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        discretePanel.setBounds(0, 0, 170, 130);
        jLayeredPane1.add(discretePanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        erlangLabel.setText("Частота");

        jSpinner1.setModel(new javax.swing.SpinnerNumberModel(Double.valueOf(1.0d), Double.valueOf(0.0010d), null, Double.valueOf(0.01d)));

        jLabel2.setText("Форма");

        jSpinner2.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        javax.swing.GroupLayout erlangPanelLayout = new javax.swing.GroupLayout(erlangPanel);
        erlangPanel.setLayout(erlangPanelLayout);
        erlangPanelLayout.setHorizontalGroup(
            erlangPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(erlangPanelLayout.createSequentialGroup()
                .addGroup(erlangPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(erlangLabel)
                    .addComponent(jLabel2)
                    .addComponent(jSpinner1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(jSpinner2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                .addContainerGap())
        );
        erlangPanelLayout.setVerticalGroup(
            erlangPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(erlangPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(erlangLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(10, Short.MAX_VALUE))
        );

        erlangPanel.setBounds(0, 0, 170, 120);
        jLayeredPane1.add(erlangPanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tick.png"))); // NOI18N
        jButton1.setText("OK");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/cross.png"))); // NOI18N
        jButton2.setText("Отмена");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLayeredPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(79, 79, 79)
                        .addComponent(jButton2)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        switch (jComboBox1.getSelectedIndex()) {
            case 0:
                choosePanel(expPanel);
                break;
            case 1:
                choosePanel(uniformPanel);
                break;
            case 2:
                choosePanel(degeneratePanel);
                break;
            case 3:
                choosePanel(discretePanel);
                break;
            case 4:
                choosePanel(erlangPanel);
                break;
            default:
                // Nothing
                break;
        }
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        dispose();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // OK
        Distribution newDist = create();
        if (newDist != null) {
            target.setDistribution(newDist);

            dispose();
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    public Distribution create() {
        switch (jComboBox1.getSelectedIndex()) {
            case 0:
                choosePanel(expPanel);
                return new ExponentialDistribution(((Node) target).getModel().getGenerator(),
                        (Double) expSpinner.getValue());
            case 1:
                choosePanel(uniformPanel);
                uniformLabel1.setForeground(Color.BLACK);
                uniformLabel2.setForeground(Color.BLACK);
                double min = (Double) uniformSpinner1.getValue();
                double max = (Double) uniformSpinner2.getValue();

                if (min > max) {
                    uniformLabel1.setForeground(Color.RED);
                    uniformLabel2.setForeground(Color.RED);
                    return null;
                }
                return new UniformDistribution(
                        ((Node) target).getModel().getGenerator(), min, max);
            case 2:
                choosePanel(degeneratePanel);
                return new DegenerateDistribution((Double) degenerateSpinner.getValue());
            case 3:
                choosePanel(discretePanel);
                boolean errors = false;

                discreteLabel1.setForeground(Color.BLACK);
                discreteLabel2.setForeground(Color.BLACK);

                String[] xt = jTextField1.getText().split(" ");
                String[] pt = jTextField2.getText().split(" ");

                double[] x = null;
                int[] p = null;

                if (xt.length != pt.length) {
                    errors = true;
                    discreteLabel1.setForeground(Color.RED);
                    discreteLabel2.setForeground(Color.RED);
                } else {
                    x = new double[xt.length];
                    p = new int[pt.length];
                }

                for (int i = 0; (!errors) && (i < pt.length); i++) {

                    try {
                        x[i] = Double.parseDouble(xt[i]);
                        if (x[i] <= 0) {
                            errors = true;
                            discreteLabel1.setForeground(Color.RED);
                        }
                    } catch (NumberFormatException ex) {
                        errors = true;
                        discreteLabel1.setForeground(Color.RED);
                    }

                    try {
                        p[i] = Integer.parseInt(pt[i]);
                        if (p[i] <= 0) {
                            errors = true;
                            discreteLabel2.setForeground(Color.RED);
                        }
                    } catch (NumberFormatException ex) {
                        errors = true;
                        discreteLabel2.setForeground(Color.RED);
                    }
                }

                int sum = 0;
                for (int i = 0; (!errors) && (i < p.length); i++) {
                    sum += p[i];
                }

                if (sum != 100) {
                    errors = true;
                    discreteLabel2.setForeground(Color.RED);
                }

                if (errors) {
                    return null;
                }

                return new DiscreteDistribution(((Node) target).getModel().getGenerator(), p, x);
            case 4:
                choosePanel(erlangPanel);
                return new ErlangDistribution(((Node) target).getModel().getGenerator(),
                        (Integer) jSpinner2.getValue(), (Double) jSpinner1.getValue());
            default:
                return null;
        }
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel degenerateLabel;
    private javax.swing.JPanel degeneratePanel;
    private javax.swing.JSpinner degenerateSpinner;
    private javax.swing.JLabel discreteLabel1;
    private javax.swing.JLabel discreteLabel2;
    private javax.swing.JPanel discretePanel;
    private javax.swing.JLabel erlangLabel;
    private javax.swing.JPanel erlangPanel;
    private javax.swing.JLabel expLabel;
    private javax.swing.JPanel expPanel;
    private javax.swing.JSpinner expSpinner;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JSpinner jSpinner2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JLabel uniformLabel1;
    private javax.swing.JLabel uniformLabel2;
    private javax.swing.JPanel uniformPanel;
    private javax.swing.JSpinner uniformSpinner1;
    private javax.swing.JSpinner uniformSpinner2;
    // End of variables declaration//GEN-END:variables
}
